﻿using DLL;
using NursingFormSystem.Model;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Xml;

namespace NursingFormSystem.Hypoglycemia
{
    public partial class LookOverHypoglycemia : Form
    {
        #region 变量声明
        public NursingFormSystem.NurFormsService.NursingForm formService = new NursingFormSystem.NurFormsService.NursingForm();
        NursingFormRecord record = new NursingFormRecord();
        Tb_User LoginUser;   //员工信息
        string Id = string.Empty;
        PatientInfo Patientinfo;    //患者信息
        string DiXueTangFaShengCiShu;     //低血糖发生次数
        string DiXueTangFaShengShiJian;     //低血糖发生时间
        string HuanZheXingMing;    //患者姓名
        string HuanZheId;
        string ZhuYuanCiShu;
        #endregion

        #region 构造函数
        public LookOverHypoglycemia(Tb_User loginUser, PatientInfo patientInfo, string diXueTangFaShengCiShu, string diXueTangFaShengShiJian, string huanZheXingMing, string huanZheId, string zhuYuanCiShu)
        {
            InitializeComponent();
            //成员变量
            this.LoginUser = loginUser;
            this.Patientinfo = patientInfo;
            this.DiXueTangFaShengCiShu = diXueTangFaShengCiShu;     //低血糖发生次数
            this.DiXueTangFaShengShiJian = diXueTangFaShengShiJian;      //低血糖发生时间
            this.HuanZheXingMing = huanZheXingMing;      //患者姓名
            this.HuanZheId = huanZheId;
            this.ZhuYuanCiShu = zhuYuanCiShu;
            BindInfo();
        }
        #endregion

        #region 点击获取信息
        public void BindInfo()
        {
            textXingMing.Text = this.HuanZheXingMing; ;     //姓名
            textDiXueTangCiShu.Text = this.DiXueTangFaShengCiShu;   //低血糖发生次数
            textZhuYuanCiShu.Text = Convert.ToInt32(Patientinfo.VISIT_ID).ToString();    //住院次数
            textDiXueTangFaShengShiJian.Text = this.DiXueTangFaShengShiJian;         //低血糖发生时间
            string sql = "select * from V_YDHL_PATIENT(NOLOCK) where PATIENT_ID = '{0}' and VISIT_ID = '{1}' ";
            sql = string.Format(sql, this.HuanZheId, this.ZhuYuanCiShu);
            DataSet ds = SqlHelper.ExecuteDataset(sql);
            DataRow row = ds.Tables[0].Rows[0];
            textXingBie.Text = row["AGE"].ToString();     //性别
            textNianLing.Text = row["SEX"].ToString();     //年龄
            textZhenDuan.Text = row["DIAGNOSE"].ToString();   //诊断 
        }
        #endregion
       

    }
}
